package rocketship;

import java.awt.Color;

/**
 *
 * @author Mikael Köhlmyr | mikael@kohlmyr.com | http://www.kmyr.net
 */
public class Phys {
        public static int FRAMES_PER_SECOND = 30, FRAME_LENGTH_MILLIS = 1000/Phys.FRAMES_PER_SECOND, MAXIMUM_VELOCITY = 10;
        public static final Color[] COLORS = {Color.GREEN, Color.BLUE, Color.RED, Color.YELLOW, Color.PINK, Color.CYAN, Color.MAGENTA};
        
        public static Color get_random_color(){
                return COLORS[(int)(Math.random() * (COLORS.length-1))];
        }
        
        public static double calc_velocity(double vstart, double acceleration, int time){
                return Math.min((vstart + (acceleration * time)), MAXIMUM_VELOCITY);
        }
}
